package com.example.demo.ai.llm.service;

import org.noear.solon.ai.chat.annotation.FunctionMapping;
import org.noear.solon.ai.chat.annotation.FunctionParam;

public class Tools {
  @FunctionMapping(description = "获取指定城市的天气情况")
  public String get_weather(
      @FunctionParam(name = "location", description = "根据用户提到的地点推测城市") String location) {
    if (location == null) {
      throw new IllegalStateException("arguments location is null (Assistant recognition failure)");
    }

    return "晴，24度"; // 可使用 “数据库” 或 “网络” 接口根据 location 查询合适数据;
  }
}
